package ktoaon.com.impl;

import ktoaon.com.BaseDao;
import ktoaon.com.KtEmpcom;
import ktoaon.pojo.KtDept;
import ktoaon.pojo.KtEmp;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 * @author www
 * @Description: 实现接口
 * @date 2020-05-30 21:14
 */

public class KtEmpcomimpl  extends BaseDao implements KtEmpcom {
    @Override
    public List<KtEmp> sele() {
        String sql = "SELECT * FROM  kt_emp";
        ResultSet rs = null;
        List<KtEmp> list = new ArrayList<KtEmp>();
        try {
            rs = super.exceuteQuery(sql, null);
            while (rs.next()) {
                KtEmp man = new KtEmp();
                man.setEmpno(rs.getInt(1));
                man.setEname(rs.getString(2));
                man.setJob(rs.getString(3));
                man.setMgr(rs.getInt(4));
                man.setHiredate(rs.getDate(5));
                man.setSal(rs.getInt(6));
                man.setComm(rs.getInt(7));
                man.setDeptno(rs.getInt(8));
                list.add(man);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
}
